package com.changhongit.controller.wemeet;

import com.changhongit.common.Result;
import com.changhongit.service.wemeet.JsapiService;
import com.tencentcloudapi.wemeet.common.exception.WemeetSdkException;
import com.tencentcloudapi.wemeet.models.jsapi.QueryUseridByACRequest;
import com.tencentcloudapi.wemeet.models.jsapi.QueryUseridByACResponse;
import com.tencentcloudapi.wemeet.models.user.QueryUsersRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wemeet/jsapi")
public class JsapiController {
    @Autowired
    private JsapiService jsapiService;
    @GetMapping
    public Result getUserid(@RequestParam String auth_code) throws WemeetSdkException {
        QueryUseridByACRequest request = new QueryUseridByACRequest();
        request.setAuth_code(auth_code);
        QueryUseridByACResponse response = jsapiService.getUserid(request);
        return Result.ok(response);


    }
}
